package com.power.sifa.approve.controller;

import com.plf.common.domain.PageDataResponse;
import com.plf.common.domain.ResponseDTO;
import com.power.sifa.approve.api.IApl_arrive_mainFeign;
import com.power.sifa.approve.model.Apl_arrive_detail;
import com.power.sifa.approve.model.pageInfo.Apl_admreviewPageInfo;
import com.power.sifa.approve.service.Apl_arrive_detailService;
import com.power.sifa.approve.service.Apl_arrive_mainService;
import com.power.sifa.supervise.model.pageInfo.Apl_supervisePageInfo;
import io.swagger.annotations.Api;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.RestController;

import java.util.Arrays;
import java.util.List;

/**
 * @author xiongzhiwen
 * @version 1.0
 * @description: TODO
 * @date 2024/3/26 9:35
 */


@Slf4j
//@PowerLog
@RestController
@Api(value = "Apl_arrive_mainController",tags={"送达案件"})
@RequiredArgsConstructor
public class Apl_arrive_mainController implements IApl_arrive_mainFeign {

    private final Apl_arrive_mainService apl_arrive_mainService;

    private final Apl_arrive_detailService apl_arrive_detailService;

    /**
     * 分页查询送达案件数据
     * @param pageInfo
     * @return
     */
    @Override
    public ResponseDTO queryArriveData(Apl_admreviewPageInfo pageInfo) {
        Assert.notNull(pageInfo, "pageInfo参数不能为空");
        PageDataResponse result  = apl_arrive_mainService.queryArriveData(pageInfo);
        return ResponseDTO.succData(result);
    }

    @Override
    public ResponseDTO getArriveDetailsById(String applyid) {
        Assert.notNull(applyid, "applyid不能为空");
        List<Apl_arrive_detail> result  = apl_arrive_detailService.findDetailByApplyIds(Arrays.asList(applyid));
        return ResponseDTO.succData(result);
    }

    @Override
    public ResponseDTO querySuperviseArriveData(Apl_supervisePageInfo pageInfo) {
        Assert.notNull(pageInfo, "pageInfo参数不能为空");
        PageDataResponse result  = apl_arrive_mainService.querySuperviseArriveData(pageInfo);
        return ResponseDTO.succData(result);
    }


}
